package com.dtsheep.elasticsearch.es.client.index;

import com.dtsheep.elasticsearch.es.client.ElasticsearchClientUtil;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.indices.GetIndexRequest;
import org.elasticsearch.client.indices.GetIndexResponse;

import java.io.IOException;

/**
 * SelectIndex
 *
 * <p>
 *     查询索引
 * </p>
 *
 * @author chuanbai
 * @date 2024/5/24
 */
public class GetIndex {

    public static void main(String[] args) throws IOException {
        GetIndexResponse response = ElasticsearchClientUtil.getEsClient()
                .indices()
                .get(new GetIndexRequest("user"), RequestOptions.DEFAULT);
        //结果
        System.out.println(response.getAliases());
        System.out.println(response.getMappings());
        System.out.println(response.getSettings());
    }
}
